//
//  SignInSetBottomVIew.m
//  YouinRTCDemo
//
//  Created by 潘欣 on 2025/8/13.
//

#import "SignInSetBottomVIew.h"

@interface SignInSetBottomVIew ()

@end
@implementation SignInSetBottomVIew
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        UILabel *titleLabel = [[UILabel alloc] init];
        titleLabel.font = [UIFont systemFontOfSize:16];
        titleLabel.textColor = RYColorForHex(@"#000000");
        titleLabel.text = @"签到设置";
        [self addSubview:titleLabel];
        [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.mas_equalTo(self);
            make.top.mas_equalTo(self).offset(10);
            make.height.offset(25);
        }];
        
        UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
        [btn setImage:[UIImage imageNamed:@"clarity_close"] forState:UIControlStateNormal];
        [btn addTarget:self action:@selector(closeView) forControlEvents:UIControlEventTouchUpInside];
        [self addSubview:btn];
        [btn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(14, 14));
            make.top.mas_equalTo(self).offset(15);
            make.right.mas_equalTo(self).offset(-16);
        }];
        
        
        UILabel *signInLabel = [[UILabel alloc] init];
        signInLabel.font = [UIFont systemFontOfSize:18];
        signInLabel.textColor = RYColorForHex(@"#0C78FF");
        signInLabel.text = @"立即签到";
        [self addSubview:signInLabel];
        [signInLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self).offset(19);
            make.top.mas_equalTo(titleLabel.mas_bottom).offset(15);
        }];
        
        
        UILabel *signInTipLabel = [[UILabel alloc] init];
        signInTipLabel.font = [UIFont systemFontOfSize:14];
        signInTipLabel.textColor = RYColorForHex(@"#0C78FF");
        signInTipLabel.text = @"设置后立即开始签到，需设置签到持续时间，在该时间段内用户在观看端进行签到。";
        signInTipLabel.numberOfLines = 0;
        [self addSubview:signInTipLabel];
        [signInTipLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self).offset(19);
            make.right.mas_equalTo(self).offset(-19);
            make.top.mas_equalTo(signInLabel.mas_bottom).offset(5);
        }];
    }
    return self;
}

- (void)closeView
{
    [self hideView];
}

@end
